// public private protecte
class Person {
    // 使用private修饰的变量在类的外部是不可读取的
    private name: string = "lisi"
    public age: number = 18

    sayName() {
        console.log(this.name);
    }
    sayAge() {
        console.log(this.age);
    }
}

var p: Person = new Person();
// console.log(p);
// console.log(p.age);
// console.log(p.name);
p.age = 30;
// console.log(p);
p.sayName();
p.sayAge();